<template>
  <footer>
    <div class="footerTop">
      <van-tabs
        v-model:active="activeName"
        color="#72CDCD"
        background="transparent"
        title-active-color="#72CDCD"
        title-inactive-color="#97DAD7"
        line-width="20%"
      >
        <van-tab title="热度榜" name="a">
          <p class="hotWord">
            <span> 每周一6:00发布|本期更 新于2021/05/21 </span>
            <span> 榜单规则 </span>
          </p>
          <ul>
            <li v-for="(item, index) in renderList" :key="index">
              <p class="brandIndex">
                {{ index + 1 }}
              </p>
              <div class="liDiv">
                <img :src="item.imgurl" alt="" />
                <div class="liDiv1">
                  <p>{{ item.title }}</p>
                  <p>{{ item.englishname }}</p>
                </div>
              </div>
              <p class="fire">
                <img src="../../assets/images/brandFire.png" alt="" />
                {{ item.score }}
              </p>
            </li>
          </ul>
        </van-tab>
        <van-tab title="评分榜" name="b">内容 2</van-tab>
        <van-tab title="回购率榜" name="c">内容 3</van-tab>
      </van-tabs>
    </div>
  </footer>
</template>

<script>
import { ref } from "vue";
import { Tab, Tabs } from "vant";
import "vant/es/tab/style";
import "vant/es/tabs/style";
import { getBrandlistApi } from "@/utils/api";
export default {
  setup() {
    const activeName = ref("a");
    return { activeName };
  },
  data() {
    return {
      renderList: [],
    };
  },
  components: {
    VanTabs: Tabs,
    VanTab: Tab,
  },

  computed: {},

  mounted() {
    this.getData();
  },

  methods: {
    async getData() {
      const res = await getBrandlistApi();
      console.log(res);
      if (res.status === 0) {
        this.renderList = res.result;
      }
    },
  },
};
</script>

<style lang="less" scoped>
footer {
  width: 100%;
  .footerTop {
    width: 100%;
    height: 93px;
    background: url(../../assets/images/brandFooterback.png);
  }
  :deep(.van-tabs) {
    padding-top: 15px;
    flex: auto;
  }
  :deep(.van-tab__text--ellipsis) {
    font-size: 30px;
    font-weight: bold;
    overflow: visible;
    padding-bottom: 20px;
    display: inline-block;
  }
  :deep(.van-tab) {
    width: 110px;
    flex: auto;
  }
  :deep(.van-tabs__wrap) {
    height: 80px;
  }
  .hotWord {
    width: 684px;
    height: 62px;
    background: #ffefdf;
    border-radius: 31px;
    margin: 20px auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    span {
      font-size: 24px;
      font-weight: bold;
      color: #fd933d;
      margin-top: 9px;
    }
  }
  ul {
    width: 100%;
    margin-top: 10px;
    li {
      width: 100%;
      border-bottom: 5px solid #f5f5f5;
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 150px;

      .liDiv {
        display: flex;
        margin-left: 40px;
        margin-right: 170px;
        .liDiv1 {
          width: 140px;
        }
        img {
          width: 100px;
          display: block;
          margin-right: 10px;
        }
        p {
          font-size: 28px;
          font-family: PingFang;
          font-weight: bold;
          color: #111111;
        }
      }
      .fire {
        font-size: 28px;
        font-family: PingFang;
        font-weight: bold;
        color: #ff6d6d;
        margin-right: 60px;
        img {
          width: 20px;
          height: 26px;
        }
      }
      .brandIndex {
        font-size: 36px;
        font-family: PingFang;
        font-weight: bold;
        color: #878787;
        margin-left: 40px;
      }
    }
  }
}
</style>
